<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'dos.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <a href="DoController?action=add">添加</a>
    <table border="1" bordercolor="blue">
    <tr>
    <td>序数</td>
    <td>ID</td>
    <td>寝室名</td>
    <td>寝室号</td>
    <td>类型</td>
    <td>备注</td>
    <td>操作</td>
    </tr>
    <c:forEach items="${dos}" var="d" varStatus="index">
    <tr>
    <td>${index.count }</td>
    <td>${d.d_id }</td>
    <td>${d.d_name }</td>
    <td>${d.d_num }</td>
    <td>
    <c:if test="${d.d_type== '1' }">男寝</c:if>
    <c:if test="${d.d_type== '0' }">女寝</c:if>
    </td>
    <td>${d.d_btw }</td>
    <td>
    <a href="DoController?action=delete&d_id=${d.d_id }">删除</a>
    <a href="DoController?action=update&d_id=${d.d_id }">修改</a>
    </td>
    </tr>
    </c:forEach>
    </table><br>
    总条数:${p.zNum };总页数:${p.zPage };当前页:${p.pIndex };
    <c:if test="${p.pIndex!=1 }">
     <a href="DoController?action=select&pIndex=1">首页</a>
     <a href="DoController?action=select&pIndex=${p.pIndex-1 }">上一页</a>
    </c:if>
    <c:if test="${p.pIndex!=p.zPage }">
     <a href="DoController?action=select&pIndex=${p.pIndex+1 }">下一页</a>
     <a href="DoController?action=select&pIndex=${p.zPage }">尾页</a>
    </c:if>
    
    
    
    
    
    
    
    
    
  </body>
</html>
